package travel;

public class Person {
	private String name;

	public Person() {
		super();
	}

	public Person(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	// 委托旅行社
	public void delegeteTravel(TravelService ts,Hotel hotel,Spots spots) {
		//预定酒店
		boolean success = ts.bookHotel(hotel);
		if (success) {
			checkIn(hotel);
			int ticketPrice = ts.buyTicket(spots);
			System.out.println("购买门票花费了" + ticketPrice);
			goSpots(spots);
		}else {
			System.out.println("没预定上，哪也没去");
		}
	}
	// 人入住酒店
	public void checkIn(Hotel hotel) {
		System.out.println(this.name + "到了" + hotel.getName()+"酒店办理入住");
	}
	// 人去景点
	public void goSpots(Spots spots) {
		System.out.println(this.name + "到了" + spots.getName()+"景点去游玩");
	}
}
